{$php_begin} include("../../system/include/header_front.php"){$php_end}{$crlf}
{$php_begin} include("../../system/labels/{$tableName}_labels.php"){$php_end}{$crlf}

{$js_include}{$crlf}

<table class='table_actions'>
<tr>
	<td class="col_action_links">
		<a href="#" id="link-back" class="iconlink a-back" onclick="go_url('index.php')">{$php_short_begin}label("common.back"){$php_end}</a>
		<a href="#" id="link-create" class="iconlink a-new" onclick="doCreate()">{$php_short_begin}label("common.create"){$php_end}</a>
		<a href="#" id="link-refresh" class="iconlink a-refresh" onclick="do_refresh()">{$php_short_begin}label("common.refresh"){$php_end}</a>
	</td>
	<td class="col_search">
		<form name='form1' method=post action="{$php_short_begin}$_SERVER["REQUEST_URI"]{$php_end}" style="text-align:right;">
{loop="fields"}{if="$value.searchable==1"}{$tab}{$tab}<span class='span_sl'>{$php_short_begin}label("{$value.label_name}"){$php_end}</span>{$crlf}{$tab}{$tab}<span class='span_sr'>{$crlf}{$tab}{$tab}{$tab}<input type=text class="text" name="{$value.search_name}" value="{$php_short_begin}deepGet("{$value.search_name}",true,""){$php_end}">{$crlf}{$tab}{$tab}</span>{$crlf}{/if}{/loop}{$crlf}{$tab}{$tab}<span class="span_sc"><input type="button" name="system_find" class="find" onclick="formFakeAASearch(document.form1)"/></span>
		</form>
	</td>
</tr>
</table>

<div id="fakeaa.list" class="div_right_main">
	<form name='form2' method='post'>
	<table class='table_list'>
	<tr>
		<td class='col_title' width='20'></td>
		<td class='col_title' width='20'></td>
{loop="fields"}{if="$value.listable==1"}{$tab}{$tab}<td class='col_title' width='{$value.width}'>{$crlf}{$tab}{$tab}{$tab}<span class='spanSort' onclick="setOrder('a__{$value.column_name}')">{$php_short_begin}label("{$value.label_name}"){$php_end}</span>{$crlf}{$tab}{$tab}</td>{$crlf}{/if}{/loop}
	</tr>
	
	{$php_begin}{$crlf}
	$sqlstr = "select {$query_columns} from {$tableName} a ". getSQLLimit("where") ;
	$grid = new gridBean();
	$grid->setOrdstr(getOrderBy("{$primaryKey}"));
	$grid->setDb($company["db_host"],$company["db_name"],$company["db_user"],$company["db_pass"]);
	$grid->init($sqlstr,$pageNo,$pageSize);

	$focusId = getFocusId($grid,"{$primaryKey}",$focusId);
	for($i=0;$i<$grid->getFetchRows();$i++){
		$id = $grid->get($i,"{$primaryKey}");
		$css = $focusId == $id ? "row_0" : "row_0" ;
		$checked = $focusId == $id ? " checked" : "" ;
{$php_end}{$crlf}
		<tr class='{$php_short_begin}$css{$php_end}' onmouseover="mouseOverRow(this)">
			<td class='col_c'>
				<img src='/system/images/kill.gif' class='aicon' title="{$php_short_begin}label("common.delete"){$php_end}" onclick="doDelete({$php_short_begin}$id{$php_end})"></img>
			</td>
			<td class='col_c'>
				<img src='/system/images/edit.gif' class='aicon' title="{$php_short_begin}label("common.update"){$php_end}" onclick="doUpdate({$php_short_begin}$id{$php_end})"></img>
			</td>
{loop="fields"}{if="$value.listable==1"}{$tab}{$tab}{$tab}<td class='col_l'>{$php_short_begin}$grid->get($i,"{$value.column_name}"){$php_end}</td>{$crlf}{/if}{/loop}
		</tr>{$crlf}
	{$php_begin}{$crlf}
	}
	echo $grid->getEmptyRows({$list_size});
	echo "</table>";
	echo $grid->getNavTable() ;
	unset($grid);

	{$php_end}
	
	</form>
</div>


{$php_begin} include("../../system/include/footer_front.php"){$php_end}